package com.yf.util;

import java.util.HashSet;
import java.util.Set;

/*********************************************************
 ** 文本合法性校验工具类
 ** <br><br>
 ** @ClassName: TextCheckUtil
 ** @author: yangfeng
 ** @date: 2024/10/18 9:15
 ** @version: 1.0.0
 *********************************************************/
public class TextAuditUtil {
    private static final Set<String> textColl = new HashSet<>();

    static {
        textColl.add("王八蛋");
        textColl.add("你奶奶的");
        textColl.add("小刺老");
        textColl.add("草泥马");
    }

    public static boolean valid(String text){
        for (String s : textColl) {
            boolean b = text.contains(s);
            if(b){
               return b;
            }
        }
        return false;
    }
}
